﻿<?xml version="1.0" encoding="UTF-8"?>
<log4net>
  <root>
    <level value="Debug"/>
    <appender-ref ref="Console" />
    <appender-ref ref="File"/>
    <appender-ref ref="Debugger"/>
  </root>

  <appender name="Console" type="log4net.Appender.ColoredConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%-4timestamp [%thread] %-5level %logger %ndc - %message%newline" />
    </layout>
    <mapping>
        <level value="INFO" />
        <foreColor value="Cyan" />
    </mapping>
    <mapping>
        <level value="DEBUG" />
        <foreColor value="Green" />
    </mapping>
    <mapping>
        <level value="WARN" />
        <foreColor value="Yellow" />
    </mapping>
    <mapping>
        <level value="ERROR" />
        <foreColor value="Red" />
    </mapping>
    <mapping>
        <level value="FATAL" />
        <foreColor value="Red" />
        <backColor value="Red, HighIntensity" />
    </mapping>  
    <threshold value="OFF"/>    
  </appender>

  <appender name="File" type="log4net.Appender.RollingFileAppender">
    <param name="File" value="$PsIonicLogsLg4n.log"/>
    <param name="AppendToFile" value="true"/>
    <rollingStyle value="Size"/>
    <maxSizeRollBackups value="5"/>
    <maximumFileSize value="2MB"/>
    <staticLogFileName value="true"/>
    <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%-5p %d{yyyy-MM-dd hh:mm:ss} – %message%newline"/>
    </layout>
    <lockingModel type="log4net.Appender.FileAppender+ExclusiveLock"/>
  </appender>
  
  <appender name="Debugger" type="log4net.Appender.OutputDebugStringAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%-5level %d{yyyy-MM-dd hh:mm:ss} - %message%newline"/>
    </layout>
  </appender>
</log4net>
